﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/User.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

<h2>Contact Us</h2>
<form id="sendMail" action="/Contact/FomSendMail">
<div>
    <table class="tbSendmail" cellpadding="0" cellspacing="0">
        <tr>
            <th>Name:</th>
            <td><input type="text" name="fullname" id="fullname" /> </td>
        </tr>
        <tr>
            <th>Mail:</th>
            <td><input type="text" name="mail" id="mail" /> </td>
        </tr>
        <tr>
            <th>Subject:</th>
            <td><input type="text" name="Subject" id="Subject" /> </td>
        </tr>
        <tr>
            <th colspan="2">Content:</th>            
        </tr>
        <tr>
            <td colspan="2">
                <textarea rows="5" cols="200" name="txtcontent" id="txtcontent"></textarea>
            </td>
        </tr>
        <tr>
            <th>CC:</th>
            <td><input type="text" name="mailcc" id="mailcc" /> </td>
        </tr>
        <tr>
            <td><button type="button" onclick="onSend();">Send</button> </td>
        </tr>
    </table>

</div>
   
</form>

    <script type="text/javascript" language="javascript">
        CKEDITOR.replace('txtcontent');
        function onSend() {
           // document.forms["sendMail"].submit();

            $.ajax({ type: 'POST', url: '/Contact/FomSendMail', data: $('#sendMail').serialize(), success: function (response) {
                if (response == "error") {
                    alert("Send Contact Fail !...");
                }
                else {
                    alert("Send Contact success !...");
                }
            }
            });
        }			
    </script>  

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="PageTitle" runat="server">
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="toolbar" runat="server">
</asp:Content>
